-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Library: Move translatable fields to block.json
files
#31120
Conversation
block.json
files
block.json
filesblock.json
files
Size Change: -98 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
1fa873a
to
ccf20e6
Compare
b851c2f
to
f371ba8
Compare
34fbc94
to
a0b20e7
Compare
I don't recall it appearing specifically in the Calls for testing, which haven't focused on those blocks until the 5th round with the Query testing, but improving theme block descriptions came up during the Go/no-go demo, which was in a way FSE testing. For example, the Site Logo description was updated in #30909 |
a0b20e7
to
c6864a3
Compare
Can confirm that this has not come up in calls for testing! |
035e8e8
to
e433b8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for folks running Gutenberg plugin with WP 5.7, is it correct that all block library translations will not be applied until translations are updated for WP 5.8?
For folks reviewing 👀 I double checked the text domain values:
Core Blocks use "default" as expected:
And when this is injected in the page via wp.i18n.setLocaleData( localeData, domain )
, domain is also set to "default" even if translation data confusingly has this set to "messages"
ac7e19e
to
9375beb
Compare
I tested the native version and I saw that the only property that uses the localized value is You can check in the Gutenberg-mobile repo the localization files that we use in the mobile app: |
9375beb
to
58ea038
Compare
58ea038
to
7811af5
Compare
Heads up that this statement from "How has this been tested?" is not being totally fulfilled, as per my previous comment, the only translation that is being applied is the one for the block's title, the rest are using the English value. I'm not sure about the impact of not having the rest of the settings localized, my impression is that it would be low as I haven't found any missing translation (apart from the ones that we already have identified) after testing this PR. However, this would be a major issue once we release the search feature in the inserter menu because it relies on the localized values of the block's settings like cc @jhnstn |
We use a consistent way of applying a context to all translations related to block types. It means that many translations need to be added processed again. It's going to happen as part of the major WordPress release process, that starts on May 25th. We will have to confirm everything goes smoothly for WordPress core, Gutenberg plugin and the mobile app. |
Ok, thanks @gziolo for the info, we'll be looking forward to this 👀 . |
Description
Depends on #30293.
Fixes #23792.
Part of #16209.
All 77 blocks were updated. Fields that are wrapped with i18n helpers were moved from
registerBlockType
call toblock.json
files.Translatable fields sourced from
block.json
have automatically applied a translation context which mostly weren't present before. This means that many translations are missing for the time being. It should get resolved during the release cycle of WordPress 5.8.How has this been tested?
All translatable fields for blocks should have their translations applied on the server when testing with WordPress.
When testing with the mobile app, all translations should still get applied as before on the client.
Screenshots
No visual changes.
Types of changes
Code quality.
Checklist:
*.native.js
files for terms that need renaming or removal).